package com.ambow.core.controller;


import com.ambow.core.po.DqInvitation;
import com.ambow.core.service.DqInvitationService;
import com.dq.gamepropaganda.common.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 邀请码表 前端控制器
 * </p>
 *
 * @author dq
 * @since 2022-09-05
 */
@Api(tags="激活")
//跨域
@CrossOrigin
@RestController
@RequestMapping("/front/dqInvitation")
public class DqInvitationController {

    @Autowired
    private DqInvitationService dqInvitationService;

    @PostMapping("/jihuo")
    @ApiOperation("激活")
    public R jihuo(String ma,Integer roleId){
        if(dqInvitationService.jihuo(ma,roleId)){
            return  R.ok().message("激活成功");
        }else{
            return R.error().message("激活失败");
        }

    }

    //判断激活码是否过期
    //判断激活码是否已经被使用




}

